package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysCrmHtddDetailMapper;
import com.ruoyi.system.domain.SysCrmHtddDetail;
import com.ruoyi.system.service.ISysCrmHtddDetailService;

/**
 * 合同订单详情Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-16
 */
@Service
public class SysCrmHtddDetailServiceImpl implements ISysCrmHtddDetailService 
{
    @Autowired
    private SysCrmHtddDetailMapper sysCrmHtddDetailMapper;

    /**
     * 查询合同订单详情
     * 
     * @param htNumber 合同订单详情主键
     * @return 合同订单详情
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public SysCrmHtddDetail selectSysCrmHtddDetailByHtNumber(String htNumber)
    {
        return sysCrmHtddDetailMapper.selectSysCrmHtddDetailByHtNumber(htNumber);
    }

    /**
     * 查询合同订单详情列表
     * 
     * @param sysCrmHtddDetail 合同订单详情
     * @return 合同订单详情
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<SysCrmHtddDetail> selectSysCrmHtddDetailList(SysCrmHtddDetail sysCrmHtddDetail)
    {
        return sysCrmHtddDetailMapper.selectSysCrmHtddDetailList(sysCrmHtddDetail);
    }

    /**
     * 新增合同订单详情
     * 
     * @param sysCrmHtddDetail 合同订单详情
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertSysCrmHtddDetail(SysCrmHtddDetail sysCrmHtddDetail)
    {
        return sysCrmHtddDetailMapper.insertSysCrmHtddDetail(sysCrmHtddDetail);
    }

    /**
     * 修改合同订单详情
     * 
     * @param sysCrmHtddDetail 合同订单详情
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateSysCrmHtddDetail(SysCrmHtddDetail sysCrmHtddDetail)
    {
        return sysCrmHtddDetailMapper.updateSysCrmHtddDetail(sysCrmHtddDetail);
    }

    /**
     * 批量删除合同订单详情
     * 
     * @param htNumbers 需要删除的合同订单详情主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysCrmHtddDetailByHtNumbers(String[] htNumbers)
    {
        return sysCrmHtddDetailMapper.deleteSysCrmHtddDetailByHtNumbers(htNumbers);
    }

    /**
     * 删除合同订单详情信息
     * 
     * @param htNumber 合同订单详情主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysCrmHtddDetailByHtNumber(String htNumber)
    {
        return sysCrmHtddDetailMapper.deleteSysCrmHtddDetailByHtNumber(htNumber);
    }
}
